-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add README for unstable position data interface #15609
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle this looks good, though it would be better to have an example that actually exists in the current positions.csv
data, which was migrated to the new approach (and now only holds Cabinet data) in everypolitician/everypolitician-data#26264
README.md
Outdated
|
||
### Interacting with unstable position data | ||
|
||
We use data from the `unstable/positions.csv` file in a legislature's directory to display cabinet positions on the website. Because this data is unstable there currently aren't methods in [the `everypolitician` gem](https://github.com/everypolitician/everypolitician-ruby) for interacting with it, so viewer-sinatra has some of its own classes for dealing with it. These classes live in the `lib/everypolitician_extensions.rb` file and are documented below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not specifically an issue here, but just for explicit clarity, it's not only because the file lives in unstable/
that we can't interact with it from the gem — it's that the way we store this data will change. The positions.csv
is just a very quick hack to let us get up and running — we still need to work out how exactly we're going to store this sort of information, and the answer may not even be within the legislature at all.
8c3afaf
to
43c9bbf
Compare
We want to add an interface for interacting with unstable position data to viewer-sinatra. This interface is an extension to the `EveryPolitician::Legislature` class, which operates on the `unstable/positions.csv` file in a legislature's directory in everypolitician-data.
43c9bbf
to
198b5a9
Compare
Ah yep, I've updated the example to use the latest data. As discussed in Slack, I've also changed this to talk about memberships instead of positions and to make this specifically about adding a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I suspect this will still need to evolve over time, but this should isolate us from underlying changes to the data for a while anyway.
What does this do?
This adds a section to the README with details on the expected interface for using the unstable position data.
Why was this needed?
We want to add an interface for interacting with unstable position data to viewer-sinatra. This interface is an extension to the
EveryPolitician::Popolo::Person
class, which operates on theunstable/positions.csv
file in a legislature's directory in everypolitician-data.Relevant Issue(s)
Part of #15606
Implementation notes
I was originally going to add the
positions
method to theLegislature
, but that doesn't really make sense, as it's people that hold positions, so that's where I've ended up putting the method.In the (very near) future we'll be adding methods for filtering positions to just those that fall between two dates, so that we can show positions for a particular term. But for now this interface should give us enough to get off the ground.